<template>
    <div>
      <dialog-edit :visible.sync="dialogVisible" :title="'硬件变更'" :editModel="editModel" :api="api" :form="form"
         >
         <el-table
            :data="tableData"
            style="width: 100%">
            <el-table-column
                prop="createTime"
                label="变更时间"
                width="180">
            </el-table-column>
            <el-table-column
                prop="changeInfo"
                label="变更信息">
                <template slot-scope="scope"  >
                    <span v-html="scope.row.changeInfo">{{scope.row.changeInfo}}</span>
                </template>
            </el-table-column>
         </el-table>
      </dialog-edit>
    </div>
</template>

<script>
  import BaseDialog from '@/pages/BaseDialog'
  import DialogEdit from '@/components/dialog/DialogEdit'
  import dymForm from '@/components/element/dymForm'
  import businessApi from '@/api/business/businessApi'
  import { timestampToTime } from '@/filters/index'
  export default {
    extends: new BaseDialog(),
    components: {
      DialogEdit,
      dymForm
    },
    data () {
      return {
        tableData: []
      }
    },
    created () {
        this.get(this.form.id)
    },
    methods: {
      get (id) {
        businessApi.dvhardwareChange.getChangeInfo(id).then(res => {
            const data = res.data
            for (var i = 0; i < data.length; i++) {
                data[i].createTime = timestampToTime(data[i].createTime)
            }
            res.code === 0 && (this.tableData = data)
        })
      }
    }
  }
</script>
